package chapter9.consumer;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-03-20 下午1:51
 */
public class Producer implements Runnable {

    private Message msg = null;

    public Producer(Message msg) {
        this.msg = msg;
    }

    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            if (i % 2 == 0) {
                this.msg.set("title a", "content a");
            } else {
                this.msg.set("title b", "content b");
            }
        }
    }
}
